package org.fg.logserver.controller;

import org.fg.logserver.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/log-test")
public class TestController {

    @Autowired
    private TestService testService;

    @PostMapping("/trigger")
    public String logTrigger(@RequestParam(name = "key", required = false, defaultValue = "0") String key) {
        return testService.logTrigger(key);
    }

    @PostMapping("/trigger-test")
    public String logTriggerTest() {
        return "test";
    }
}
